xen/x86: domain: Remove specific case when allocating struct domain
authorJulien Grall <jgrall@amazon.com>
Mon, 20 Jan 2020 14:10:57 +0000 (14:10 +0000)
committerJulien Grall <julien@xen.org>
Fri, 31 Jan 2020 18:50:32 +0000 (18:50 +0000)
commit7608f33452ae417ee2b7406e06add7c4e12db9fa
treecb1b14f6bb7cedaca873a070c425c4fecd639165
parentd9c4499c18e1d235f99e27fe9f2cb725d6ccf5cc
xen/x86: domain: Remove specific case when allocating struct domain

Commit 8916fcf4577 "x86/domain: compile with lock_profile=y enabled"
allowed the struct domain to use more than a PAGE_SIZE (i.e 4096).
However, the function free_domheap_struct() will only free the first
page.

We could modify the free part to free the correct number of pages, but
the structure has been fitting in a page (even with lock profile
enabled) since commit 428607a410 "x86: shrink 'struct domain', was
already PAGE_SIZE" (part of Xen 4.7).

Therefore, the specific case for lock profile is now removed.

This is not a security issue because struct domain can only be bigger
than a page size for lock profiling. The feature can only be selected
in DEBUG and EXPERT mode.

Fixes: 8916fcf4577 ("x86/domain: compile with lock_profile=y enabled")
Reported-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
xen/arch/x86/domain.c